package org.x.casemodule.mapper;

import com.mybatisflex.core.BaseMapper;
import com.mybatisflex.core.query.QueryWrapper;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.x.casemodule.entity.ScheduleReminderEntity;

import java.util.List;

@Mapper
public interface ScheduleReminderMapper extends BaseMapper<ScheduleReminderEntity> {

    @Delete("DELETE FROM schedule_participant WHERE event_id = #{id}")
    int deleteByEventId(@Param("id") Long eventId);// 显式指定参数名

    @Delete("DELETE FROM schedule_reminder WHERE event_id = #{id}")
    int DeleteByEventId(@Param("id") Long eventId);

    @Select("SELECT * FROM schedule_reminder WHERE event_id = #{eventId}")
    List<ScheduleReminderEntity> findByEventId(@Param("eventId") Long eventId);
}
